home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PASCAL
/
0635.ZIP
/
GETDATE.INC
< prev
next >
Wrap
Text File
|
1987-07-23
|
755b
|
35 lines
Type
MG_DAteStr = String[8];
Function CurrentDate : MG_DateStr;
{** Returns a date string from DOS in the format '99/99/99' **}
Type
RegPack = Record
AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : Integer;
End;
Var
Registers : RegPack;
Month,Day,Year : Integer;
MStr,DStr : String[2];
YStr : String[4];
Begin
With Registers do
AX := $2A shl 8;
MSDos(Registers);
With Registers do
Begin
Month := Hi(DX);
Day := Lo(DX);
Year := CX;
Str(Month:2,MStr);
If MStr[1] = ' ' then
MStr[1] := '0';
Str(Day:2,DStr);
If DStr[1] = ' ' then
DStr[1] := '0';
Str(Year:2,YStr);
End;
CurrentDate := Concat(MStr,'/',DStr,'/',Copy(YStr,3,2));
End; {CurrentDate}